<template>
  <div class="page">
    <NavBar title="建议与反馈" :isBack="isBack" />
    <div class="main">
      <van-field
        v-model="message"
        rows="4"
        autosize
        maxlength="100"
        label=""
        type="textarea"
        placeholder="请输入你的建议"
      />
      <div style="margin-top: 15px">
        <van-button type="primary" block round @click="sub"> 提交 </van-button>
      </div>
    </div>
  </div>
</template>
<script setup>
import { ref, onMounted } from "vue";
import { useRouter } from "vue-router";
import NavBar from "../components/NavBar.vue";
import { showToast } from "vant";
const router = useRouter();
const isBack = ref(true);
const message = ref("");
const sub = () => {
  console.log(message.value);
  if (message.value == "") {
    return showToast("请输入建议");
  }
  showToast("提交成功");
  message.value = "";
};
onMounted(() => {
  console.log("mounted");
  console.log(router);
});
</script>
<style scoped lang="less">
.page {
  width: 100%;
  min-height: 100vh;
  background: #f8f8f8;
}
.main {
  margin: 15px;
}
</style>
